//
//  MFWServiceUtils.m
//  MFWSdk
//
//  Created by Song Xiaofeng on 13-8-22.
//  Copyright (c) 2013年 Mafengwo Inc. All rights reserved.
//

#import "MFWServiceUtils.h"

@implementation MFWServiceUtils

+ (NSError*)parseMFWServiceError:(MFWJson*)rootJson;
{
    if (rootJson)
    {
        int errorCode = [rootJson intValueForKey:@"rc"];
        if (errorCode != 0)
        {
            NSString *errorMessage = [rootJson stringValueForKey:@"rm"];
            NSError *error = [NSError errorWithDomain:MFWErrorDomain code:errorCode userInfo:@{kMFWErrorInfo_Str_Msg: errorMessage}];
            return error;
        }
    }
    return nil;
}
@end
